<template>
    <el-dialog
            title="设置归档年限"
            v-bind="$attrs" v-on="$listeners"
            width="380px"
            append-to-body
            :close-on-click-modal="false"
            :before-close="handleClose">
        <el-form ref="elForm" :model="formData" size="medium" label-width="120px">
            <el-form-item label="归档年限" prop="retention">
                <el-radio-group v-model="formData.retention">
                    <el-radio label="Y">永久</el-radio>
                    <el-radio label="30">30年</el-radio>
                    <el-radio label="10">10年</el-radio>
                    <el-radio label="C">长期</el-radio>
                    <el-radio label="D">短期</el-radio>
                    <el-radio label="15">15年</el-radio>
                    <el-radio label="5">5年</el-radio>
                    <el-radio label="D30">定期30年</el-radio>
                    <el-radio label="D10">定期10年</el-radio>
                </el-radio-group>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
    <el-button @click="handleClose">取 消</el-button>
    <el-button type="primary" @click="handelConfirm">确 定</el-button>
  </span>
    </el-dialog>
</template>

<script>
    import schoolSignature from "@/api/officialDocument/schoolSignature/index";

    export default {
        name: "GuiDangDialog",
        components: {},
        data() {
            return {
                formData: {
                    retention: "Y",
                },
            };
        },
        props: ["row"],
        created() {
        },
        methods: {
            handleClose(done) {
                this.$emit('update:visible', false)
            },
            handelConfirm() {
                schoolSignature.documentArchives(this.row.id, this.formData).then(res => {
                    this.msgSuccess(res.msg)
                    this.$emit("reloadList")
                    this.handleClose()
                })
            },
        }
    };
</script>
<style lang="scss" scoped>
    ::v-deep .el-dialog .el-dialog__body {
        padding: 20px 20px 0px 0px;
    }
    .el-radio{
        width: 100%;
        line-height: 30px;
    }
</style>
